package com.smap.layer;

import java.util.ArrayList;
import java.util.List;

public abstract class InfoHandler {
	int layerNumber;
	List<Object> infos = new ArrayList<Object>();

	public void start(int layerNumber) {
		infos.clear();
		this.layerNumber = layerNumber;
	}

	public void execute(Object info) {
		layerNumber--;
		infos.add(info);
		if (layerNumber == 0) {
			render(infos);
		}
	}

	public abstract void render(List<Object> infos);
}
